<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="oBtnDownload">点击下载</button>
<script src="https://cdn.bootcss.com/axios/0.19.2/axios.min.js"></script>
<script type="module">
import {downloadDirect} from '../js/utils.js';
oBtnDownload.onclick = function(){
    axios.get('http://localhost:8888/api/downloadUrl').then(res => {
        if(res.data.code === 0) {
            downloadDirect(res.data.data.url);
        }
    })
}
</script>
</body>
</html>